﻿using UnityEngine;
using System.Collections;

public class HealthText : MonoBehaviour {

    public HealthInfo health;
    private GUIText text;

	// Use this for initialization
	void Start () {
        text = gameObject.GetComponent<GUIText>();
	}
	
	// Update is called once per frame
	void Update () {
        if (health != null)
        {
            text.text = health.Health.ToString();
        }
        else
        {
            text.text = (-1).ToString();
        }
	}
}
